<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Yangzi
 * Date: 12-11-24
 * Time: 下午1:10
 */

include(dirname(dirname(dirname(__FILE__))) . '/bootstrap.php');

if(!isset($_REQUEST['url'])){
	echo Response::JSON(AJ_RET_FORB);
	exit;
}

$url_arr = getDomainAndIdByBaobeiUrl($_REQUEST['url']);

if(!empty($url_arr)){
    $data = array('url' => $url_arr['url']);

    $ret = (array)json_decode(curl_post_contents('http://www.whoopsfeed.com/love/api/take_baobei_info/take_baobei_info.php',$data));

    if($ret){
        $ret['url'] = $url_arr['url'];
        $ret['flag'] = $url_arr['id'];
        $ret['domain'] = $url_arr['domain'];
        echo Response::JSON(AJ_RET_SUCC, array('baobei_info' => $ret));
    }else{
        echo Response::JSON(AJ_RET_FAIL);
    }

}else{
    echo Response::JSON(AJ_RET_FORB);
}

exit;